#include "my_headerT2csC.h"

/* Usage:  */
int main(int argc, char *argv[]){
    ARGS_CHECK(argc,3);
    int sfd = socket(AF_INET,SOCK_STREAM,0);
    struct sockaddr_in san;
    memset(&san,0,sizeof(san));
    san.sin_family = AF_INET;
    san.sin_port = htons(atoi(argv[2]));
    san.sin_addr.s_addr = inet_addr(argv[1]);
    connect(sfd,(struct sockaddr *)&san,sizeof(san));






    while(1){
        char sendOpt[4096] = {0};
        fgets(sendOpt, sizeof(sendOpt), stdin);
        send(sfd,sendOpt,strlen(sendOpt)+1,0);
        bzero(sendOpt,sizeof(sendOpt));
        recv(sfd,sendOpt,sizeof(sendOpt),0);
        printf("S:%s\n",sendOpt);
    }







    /* sleep(10); */
    /* recv_file(sfd); */
    printf("recv is done...\n");

    return 0;
}

